home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d987.lha / MCalc / Source / MCalcASM.Asm < prev    next >
Assembly Source File  |  1994-04-05  |  4KB  |  236 lines

  1.         NOLIST
  2.  
  3. *AUTO:        smake MCalc
  4.  
  5.         opt o+,ow-,o6+,DEBUG,NOLIST,ALINK
  6.  
  7. ;* $Revision Header built automatically *************** (do not edit) ************
  8. ;*
  9. ;* © Copyright by GuntherSoft
  10. ;*
  11. ;* File             : SnakeSYS:CPrgs/MUICalc/MCalc.asm
  12. ;* Created on       : Sunday, 03.10.93 23:16:55
  13. ;* Created by       : Kai Iske
  14. ;* Current revision : V1.0
  15. ;*
  16. ;*
  17. ;* Purpose
  18. ;* -------
  19. ;*   - Small (very very small) support routines for MCalc ;)
  20. ;*
  21. ;* Revision V1.0
  22. ;* --------------
  23. ;* created on Sunday, 03.10.93 23:16:55  by  Kai Iske.   LogMessage :
  24. ;*     --- Initial release ---
  25. ;*
  26. ;*********************************************************************************
  27.  
  28.  
  29.         XDEF    _MyASL
  30.         XDEF    _MyASR
  31.         XDEF    _MyLSL
  32.         XDEF    _MyLSR
  33.         XDEF    _MyROL
  34.         XDEF    _MyROR
  35.         XDEF    _MyXOR
  36.         XDEF    _MyNAND
  37.         XDEF    _MyNOR
  38.         XDEF    _MyNXOR
  39.         XDEF    _DoCreatePool
  40.         XDEF    _DoDeletePool
  41.         XDEF    _AllocVecPool
  42.         XDEF    _FreeVecPool
  43.  
  44.         XREF    _IntBase
  45.         XREF    _AsmCreatePool
  46.         XREF    _AsmDeletePool
  47.         XREF    _AsmAllocPooled
  48.         XREF    _AsmFreePooled
  49.  
  50. _MyASL        tst.l    d1
  51.         beq.s    .End
  52.         subq.l    #1,d1
  53. .Loop        cmp.w    #7,_IntBase(a4)
  54.         bne.s    .Try16
  55.         asl.b    #1,d0
  56.         bra.s    .LoopEnd
  57. .Try16        cmp.w    #8,_IntBase(a4)
  58.         bne.s    .Try32
  59.         asl.w    #1,d0
  60.         bra.s    .LoopEnd
  61. .Try32        asl.l    #1,d0
  62. .LoopEnd    dbf    d1,.Loop
  63. .End        rts
  64.  
  65.  
  66. _MyASR        tst.l    d1
  67.         beq.s    .End
  68.         subq.l    #1,d1
  69. .Loop        cmp.w    #7,_IntBase(a4)
  70.         bne.s    .Try16
  71.         asr.b    #1,d0
  72.         bra.s    .LoopEnd
  73. .Try16        cmp.w    #8,_IntBase(a4)
  74.         bne.s    .Try32
  75.         asr.w    #1,d0
  76.         bra.s    .LoopEnd
  77. .Try32        asr.l    #1,d0
  78. .LoopEnd    dbf    d1,.Loop
  79. .End        rts
  80.  
  81.  
  82. _MyLSL        tst.l    d1
  83.         beq.s    .End
  84.         subq.l    #1,d1
  85. .Loop        cmp.w    #7,_IntBase(a4)
  86.         bne.s    .Try16
  87.         lsl.b    #1,d0
  88.         bra.s    .LoopEnd
  89. .Try16        cmp.w    #8,_IntBase(a4)
  90.         bne.s    .Try32
  91.         lsl.w    #1,d0
  92.         bra.s    .LoopEnd
  93. .Try32        lsl.l    #1,d0
  94. .LoopEnd    dbf    d1,.Loop
  95. .End        rts
  96.  
  97.  
  98. _MyLSR        tst.l    d1
  99.         beq.s    .End
  100.         subq.l    #1,d1
  101. .Loop        cmp.w    #7,_IntBase(a4)
  102.         bne.s    .Try16
  103.         lsr.b    #1,d0
  104.         bra.s    .LoopEnd
  105. .Try16        cmp.w    #8,_IntBase(a4)
  106.         bne.s    .Try32
  107.         lsr.w    #1,d0
  108.         bra.s    .LoopEnd
  109. .Try32        lsr.l    #1,d0
  110. .LoopEnd    dbf    d1,.Loop
  111. .End        rts
  112.  
  113.  
  114. _MyROL        tst.l    d1
  115.         beq.s    .End
  116.         subq.l    #1,d1
  117. .Loop        cmp.w    #7,_IntBase(a4)
  118.         bne.s    .Try16
  119.         rol.b    #1,d0
  120.         bra.s    .LoopEnd
  121. .Try16        cmp.w    #8,_IntBase(a4)
  122.         bne.s    .Try32
  123.         rol.w    #1,d0
  124.         bra.s    .LoopEnd
  125. .Try32        rol.l    #1,d0
  126. .LoopEnd    dbf    d1,.Loop
  127. .End        rts
  128.  
  129.  
  130. _MyROR        tst.l    d1
  131.         beq.s    .End
  132.         subq.l    #1,d1
  133. .Loop        cmp.w    #7,_IntBase(a4)
  134.         bne.s    .Try16
  135.         ror.b    #1,d0
  136.         bra.s    .LoopEnd
  137. .Try16        cmp.w    #8,_IntBase(a4)
  138.         bne.s    .Try32
  139.         ror.w    #1,d0
  140.         bra.s    .LoopEnd
  141. .Try32        ror.l    #1,d0
  142. .LoopEnd    dbf    d1,.Loop
  143. .End        rts
  144.  
  145.  
  146. _MyXOR        cmp.w    #7,_IntBase(a4)
  147.         bne.s    .Try16
  148.         eor.b    d1,d0
  149.         bra.s    .End
  150. .Try16        cmp.w    #8,_IntBase(a4)
  151.         bne.s    .Try32
  152.         eor.w    d1,d0
  153.         bra.s    .End
  154. .Try32        eor.l    d1,d0
  155. .End        rts
  156.  
  157.  
  158. _MyNAND        cmp.w    #7,_IntBase(a4)
  159.         bne.s    .Try16
  160.         not.b    d1
  161.         and.b    d1,d0
  162.         bra.s    .End
  163. .Try16        cmp.w    #8,_IntBase(a4)
  164.         bne.s    .Try32
  165.         not.w    d1
  166.         and.w    d1,d0
  167.         bra.s    .End
  168. .Try32        not.l    d1
  169.         and.l    d1,d0
  170. .End        rts
  171.  
  172.  
  173. _MyNOR        cmp.w    #7,_IntBase(a4)
  174.         bne.s    .Try16
  175.         not.b    d1
  176.         or.b    d1,d0
  177.         bra.s    .End
  178. .Try16        cmp.w    #8,_IntBase(a4)
  179.         bne.s    .Try32
  180.         not.w    d1
  181.         or.w    d1,d0
  182.         bra.s    .End
  183. .Try32        not.l    d1
  184.         or.l    d1,d0
  185. .End        rts
  186.  
  187.  
  188. _MyNXOR        cmp.w    #7,_IntBase(a4)
  189.         bne.s    .Try16
  190.         not.b    d1
  191.         eor.b    d1,d0
  192.         bra.s    .End
  193. .Try16        cmp.w    #8,_IntBase(a4)
  194.         bne.s    .Try32
  195.         not.w    d1
  196.         eor.w    d1,d0
  197.         bra.s    .End
  198. .Try32        not.l    d1
  199.         eor.l    d1,d0
  200. .End        rts
  201.  
  202.  
  203.  
  204.  
  205. _DoCreatePool    move.l    a6,-(sp)
  206.         move.l    $4.w,a6
  207.         jsr    _AsmCreatePool
  208.         move.l    (sp)+,a6
  209.         rts
  210. _DoDeletePool    move.l    a6,-(sp)
  211.         move.l    $4.w,a6
  212.         jsr    _AsmDeletePool
  213.         move.l    (sp)+,a6
  214.         rts
  215.  
  216.  
  217. _AllocVecPool    movem.l    d1/a0/a6,-(sp)
  218.         addq.l    #4,d0
  219.         move.l    d0,-(sp)
  220.         move.l    $4.w,a6
  221.         jsr    _AsmAllocPooled
  222.         move.l    (sp)+,d1
  223.         tst.l    d0
  224.         beq.s    .Error
  225.         move.l    d0,a0
  226.         move.l    d1,(a0)+
  227.         move.l    a0,d0
  228. .Error        movem.l    (sp)+,d1/a0/a6
  229.         rts
  230. _FreeVecPool    move.l    a6,-(sp)
  231.         move.l    -(a1),d0
  232.         move.l    $4.w,a6
  233.         jsr    _AsmFreePooled
  234.         move.l    (sp)+,a6
  235.         rts
  236.